<?php

namespace Plugin\MultiSeller\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class SellerGroupResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param Request $request
     * @return array
     */
    public function toArray($request): array
    {
        $data = [
            'id'                  => $this->id,
            'name'                => $this->description->name        ?? '',
            'description'         => $this->description->description ?? '',
        ];

        return $data;
    }
}
